#ifndef ANNO_ITEM_H
#define ANNO_ITEM_H
#include <osg/Geometry.h>
#include <osgEarthAnnotation/CircleNode.h>
#include <osgEarthAnnotation/FeatureNode.h>
#include <osgEarthAnnotation/RectangleNode>
#include <osgEarthAnnotation/EllipseNode>
#include <osgEarthAnnotation/LabelNode.h>
#include <osgEarthAnnotation/PlaceNode.h>
#include <osgEarthAnnotation/LocalGeometryNode>
#include <osgEarthAnnotation/ModelNode>
#include "Def.h"
#include "StyleManager.h"
#include "Property.h"

struct IAnnoItemRouter
{
	virtual osg::Node* asOsgNode()const = 0;
	virtual osgEarth::Symbology::Geometry* asGeometry()const = 0;
	virtual osgEarth::Annotation::CircleNode* asCicleNode()const = 0;
	virtual osgEarth::Annotation::EllipseNode* asEllipseNode()const = 0;
	virtual osgEarth::Annotation::FeatureNode* asFeatureNode()const = 0;
	virtual osgEarth::Annotation::LabelNode* asLabelNode()const = 0;
	virtual osgEarth::Annotation::PlaceNode* asPlaceNode()const = 0;
};

class IAnnoItem : public IPropertySet,public IStyleHelper,public INamedObject,public IDeleter
{
public:
	virtual QString getAnnoItemTypeString()const = 0;
	virtual const IAnnoItemRouter* getItemRouter()const = 0;
};

class IAnnoItemManager : public IPropertySet,public IStyleHelper
{
public:
	static  SDK_EXPORT_API IAnnoItemManager* instance();
	virtual IAnnoItem* createItem(const QString& name,const QString& type,double lod = std::numeric_limits<double>::max()) = 0;
	virtual void setCurrentItem(const QString& name) = 0;
	virtual void setCurrentItemAsNull() = 0;
	virtual IAnnoItem* getCurrentItem()const = 0;
	virtual void removeItem(const QString& name) = 0;
	virtual QStringList getItemList()const = 0;
	virtual IAnnoItem* getAnnoItemByName(const QString& name) = 0;
	virtual int getItemCount() = 0;
	virtual void clear() = 0;

	virtual void setItemTwinkle(bool enable) = 0;
	virtual bool isItemTwinkle()const = 0;
};

#define GLOBAL_ANNOITEM_MANAGER IAnnoItemManager::instance()

#endif

